import request from "@/utils/request";

export function getMnpConfig() {
  return request.get({ url: "/index/getMnpConfig" });
}

export function setMnpConfig(params: any) {
  return request.post({ url: "/index/configMnp", params });
}

export function getMansionList(params: any) {
  return request.get({ url: "/mansion/list", params });
}

export function addMansion(params: any) {
  return request.post({ url: "/mansion/add", params });
}
export function editMansion(params: any) {
  return request.post({ url: "/mansion/edit", params });
}
export function createMansionSn() {
  return request.get({ url: "/mansion/create_sn" });
}
export function findMansionDetail(params: any) {
  return request.get({ url: "/mansion/detail", params });
}
export function delMansion(params: any) {
  return request.get({ url: "/mansion/del", params });
}

// 套餐------------------
export function createOrderMealSn() {
  return request.get({ url: "/order_meal/create_sn" });
}
export function getOrderMealList(params: any) {
  return request.get({ url: "/order_meal/list", params });
}
export function addOrderMeal(params: any) {
  return request.post({ url: "/order_meal/add", params });
}
export function editOrderMeal(params: any) {
  return request.post({ url: "/order_meal/edit", params });
}
export function findOrderMealDetail(params: any) {
  return request.get({ url: "/order_meal/detail", params });
}
export function delOrderMeal(params: any) {
  return request.get({ url: "/order_meal/del", params });
}

// 菜单
export function getOrderMenuList(params: any) {
  return request.get({ url: "/order_menu/list", params });
}
export function submitOrderMenu(params: any) {
  return request.post({ url: "/order_menu/submit", params });
}
export function orderMenuSetValid(params: any) {
  return request.get({ url: "/order_menu/setValid", params });
}

export function orderMenuGetValid() {
  return request.get({ url: "/order_menu/getValid" });
}

// 订单列表
export function getOrderList(params: any) {
  return request.post({ url: "/order/list", params });
}
export function orderDelivered(params: any) {
  return request.post({ url: "/order/delivered", params });
}
export function orderRrefund(params: any) {
  return request.post({ url: "/order/refund", params });
}
export function getOrderDetail(params: any) {
  return request.get({ url: "/order/detail", params });
}
export function exportOrderList(params: any) {
  return request.get(
    {
      responseType: "blob",
      url: "/order/export",
      params,
    },
    {
      isTransformResponse: false,
    }
  );
}
// 截止退款
export function orderNotRefund(params: any) {
  return request.post({ url: "/order/notRefund", params });
}

// 开始配送
export function orderDelivering(params: any) {
  return request.post({ url: "/order/delivering", params });
}

// 一键配送
export function orderAllDelivery() {
  return request.get({ url: "/order/allDelivery" });
}

// 一键送达
export function orderAllDone() {
  return request.get({ url: "/order/allDelivered" });
}

// 优惠券列表
export function getCouponList(params: any) {
  return request.get({ url: "/coupon/list", params });
}
export function setCouponConfig(params: any) {
  return request.post({ url: "/coupon/config", params });
}
export function createCoupon(params: any) {
  return request.post({ url: "/coupon/create", params });
}
export function getCouponConfig() {
  return request.get({ url: "/coupon/getConfig" });
}
export function getProposalList(params: any) {
  return request.get({ url: "/proposal/list", params });
}
export function adoptProposal(params: any) {
  return request.get({ url: "/proposal/adopt", params });
}
